<?php
require_once("init.php");

$text=$_POST['text'];

$text=str_replace("\\\"","&quot;",$text);
$text=str_replace("\\'","&#39;",$text);
$url="http://twitter.com/statuses/update.json";
$post_data = "status=".urlencode($text);

$reply_id=$_POST['reply_id'];
if(!is_null($reply_id)){
	$post_data=$post_data."&in_reply_to_status_id=".$reply_id;
}
post_to_twitter($url,$post_data);

//I post it, it should not be spam
//unlearn
unlearn_by_b8($text, 'spam');

//learn
learn_by_b8($text, 'ham');

//empty cache
delete_cache('all');

header("Location: index.php");
?>